<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>菜单管理</title>
		<link rel="stylesheet" href="../css/common.css" type="text/css" />
	    <link href="css/style.css" rel="stylesheet" type="text/css" />
		<script language="JavaScript" type="text/javascript">
				function checkform(argv){
					var checktree=document.getElementsByName("checktree");
					var haveselect=false;
					var selects=-1;
					for(var i=0;i<checktree.length;i++){
						if(checktree[i].checked == true){
							haveselect=true;
							selects=checktree[i].value;
							break;
							}
					}
					if(!haveselect && argv=='1'){
						location.href='menu.do?method=menuAdd&prv=insert&pid=-1';
					}else if(!haveselect && argv!='1'){
						alert('操作前请先选择！');
					}else if(haveselect && argv=='2'){
						location.href='menu.do?method=searchById&prv=update&menuId='+selects;
					}else if(haveselect && argv=='3'){
						if(confirm('您确认要删除吗？')){
						 location.href='menu.do?method=delete&prv=delete&menuId='+selects;}
						 }else if(haveselect && argv=='1'){
						location.href='menu.do?method=menuAdd&prv=insert&pid='+selects;
					}
				}
			</script>
	</head>

	<body>
		<div id="man_zone">
		<center></center>
		<table width="100%" border="0" cellspacing="0" cellpadding="0">
			<tr>
				<td height="46" background="images/right_nav_bg.gif">
					<table width="98%" border="0" align="center" cellpadding="0"
						cellspacing="0" class="right_g_bk">
						<tr>
							<td width="17" height="50" bgcolor="#D4E8F5">
								<div align="center">
									<img src="images/bt.gif" width="8" height="40" />
								</div>
							</td>
							<td width="460" bgcolor="#D4E8F5">
								<span class="STYLE1">菜单管理</span>&nbsp;&nbsp;&nbsp;<c:out value="${message}" />
							</td>
							<td width="292" bgcolor="#D4E8F5">
							<c:if test="${prv.insert != null}">
								<input type="button" value="添  加" onclick="checkform('1')"   />    &nbsp;&nbsp; 
							</c:if>
							<c:if test="${prv.update != null}">	
								<input type="button" value="编  辑" onclick="checkform('2')"   />    &nbsp;&nbsp; 
							</c:if>
							<c:if test="${prv.delete != null}">
								<input type="button" value="删  除" onclick="checkform('3')"   />    &nbsp;&nbsp; 
							</c:if>
								 <br />
							</td>
						</tr>
					</table>
				</td>
			</tr>
			<tr>
				<td style="padding-top: 10px;" align="left">
					<table width="100%" height="100%">
						<tr height="60">
							<td>
							
									<link rel="StyleSheet" href="../javascripts/dtree.css" type="text/css" />
									<script language="JavaScript" type="text/javascript"
										src="../javascripts/dtree.js"></script>
									<div id="tree"></div>
									<script language="JavaScript" type="text/javascript">
											d = new dTree('d');
											<c:out value="${bean.str}"   escapeXml="false" ></c:out>
					                        document.getElementById('tree').innerHTML=d.toString();
									</script>
							</td>
						</tr>
					</table>
				</td>
			</tr>
		</table>
</div>
	</body></html>